package com.moonfish.base.controller.Response;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * Created by mayu on 2017/7/11.
 * email:showmara@qq.com
 */
@Data
@ApiModel(description = "返回实体")
public class BaseResponseBody<T> {
    @ApiModelProperty(value = "返回时间戳",required = true)
    private long timestamp;
    @ApiModelProperty(value = "状态码",required = true)
    private ErrCode status;
    @ApiModelProperty(value = "返回信息描述",required = true)
    private String message;
    @ApiModelProperty(value = "请求路径",required = true)
    private String path;
    @ApiModelProperty(value = "返回内容实体",required = true)
    private T body;

    public BaseResponseBody(ErrCode status, String message, String path, T body) {
        this.timestamp = System.nanoTime();
        this.status = status;
        this.message = message;
        this.path = path;
        this.body = body;
    }
}
